<!-- 会员中心主内容区 -->
<div class="page-article" id="main">
  <!-- 到货通知 -->
  
  <div id="member_notify" class="member-notify">
    <div class="member-title">
    </div>
    <div class="member-mod">
      <table class="member-grid" style="text-align:center">
        <thead>
		  <th><{t}>缩略图<{/t}></th>
		  <th><{t}>货号<{/t}></th>
		  <th><{t}>状态<{/t}></th>
		  <th><{t}>返点<{/t}></th>
          <th><{t}>金额<{/t}></th>
          <th><{t}>操作<{/t}></th>
        </thead>
        <tbody <{if !($browser.name=="IE" && ($brower.ver == 6 || $browser.ver == 7))}> class="first"<{/if}>>
			<{foreach from=$goods item=goods name=name}>
			<tr <{if $smarty.foreach.name.iteration == 1}> class="first"<{/if}>>
				<td>
					<{if $goods.image_default_id}><img src="<{$goods.image_default_id|storager:'s'}>" width="40px;" style="vertical-align: middle;"><{/if}>
					<a href="<{link app=b2c ctl=site_product arg0=$goods.product.0.product_id}>" target="_blank" style=" display:block; margin:0 auto; text-align:center;white-space:nowrap; max-width:80px; overflow:hidden; text-overflow:ellipsis;"><{$goods.name|default:$goods.name}> <{$goods.spec_info|spec_desc}></a>
				</td>
				<td><{$goods.product.0.bn}></td>
				<td><{t}><{$goods.status == 'true' ? '上架' : '下架'}><{/t}></td>
				<td>
					<{t}><{$goods.brand.account_mode == 'rebate' ? '返点' :'结算价'}><{/t}>
					<{$goods.brand.rebate}>%
				</td>
				<!--如果有阶梯价就显示阶梯价-->
				<td><{t}>现价<{/t}>：<ins class="price"><{$goods.price}></ins>
					<br>
					<!--<del><{t}>原价<{/t}>：<{$goods.mktprice}></del>-->
					<{if $goods.ladder.is_open != 'false'}>
						<{t}>阶梯价<{/t}><{$goods.ladder.ladder_price}><{t}>数量<{/t}><{$goods.ladder.ladder_num}>
					<{else}>
						<del><{t}>原价<{/t}>：<{$goods.mktprice}></del>
					<{/if}>
				</td>
				<td class="actions">
					<a title="" href="<{link app=b2c ctl=site_member act=goods_edit arg0=$goods.goods_id arg1=$opt}>"><{t}>编辑<{/t}></a>
					<br/>
					<{if $goods.status eq 'true'}>
						<a href="javascript:;" class="btn-offsell"><{t}>下架<{/t}></a>
					<{else}>
						<a href="javascript:;" class="btn-onsell"><{t}>上架<{/t}></a>
					<{/if}>
				</td>
			</tr>
			<{/foreach}>
        </tbody>
      </table>
    </div>
    <{pagers data=$pager}>
  </div>
</div>
<script>
	$('main').addEvents({
		//商品上架
		'click:relay(.btn-onsell)': function(e) {
			e.stop();
			Dialog.confirm('<{t}>确定产品上架<{/t}>！', function(e){
                if(e) async(this, {
                    url: "<{link app=b2c ctl=site_member act=goods_onsell}>",
                    method: 'post',
					data:'goods_id=<{$goods.goods_id}>&response_json=true'
                });
            }.bind(this));
		},
		//商品下架
		'click:relay(.btn-offsell)': function(e) {
			e.stop();
			Dialog.confirm('<{t}>确定产品下架<{/t}>！', function(e){
                if(e) async(this, {
                    url: "<{link app=b2c ctl=site_member act=goods_offsell}>",
                    method: 'post',
					data:'goods_id=<{$goods.goods_id}>&response_json=true'
                });
            }.bind(this));
		},
	});
</script>